***********************************************
******** CORE STATISTICS - SPANISH GDP ********
***********************************************
/*
In this do file, we import and prepare the data on
the Spanish GDP.

*/

*----------------
* PATHS
*----------------
global replication `c(pwd)'
global data "$replication\Data"
global inter "$replication\Dta - Intermediate"
global final "$replication\Dta - Final"
global graphs "$replication\Graphs"

*================
* IMPORTING DATA
*================
clear all
import excel "$data\GDP_Interpolation.xlsx", sheet("Results Nominal GDP") firstrow

*================
* HOUSEKEEPING
*================
* Nominal GDP
rename NOMINALGDPInterpolation nom_gdp
label var nom_gdp "Nominal GDP (interpolation)"

* Date variables
gen month_n = real(MonthNumber)
keep Year month_n nom_gdp
gen ym_date=ym(Year,month_n)
drop if missing(ym_date)
label var ym_date "Month and Year (date)"

keep ym_date nom_gdp
save "$inter\Spain_NominalGDP.dta", replace
